home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / rexx / xdmd1.lha / Diary.xdme < prev    next >
Text File  |  1994-10-24  |  1KB  |  50 lines

  1. /* Diary.xdme */
  2. /* An ARexx script for maintaining a diary with XDME */
  3.  
  4. if ~show("L","rexxreqtools.library") then
  5.     if ~addlib("rexxreqtools.library", 0, -30) then exit
  6.  
  7. /* Change these variables to suit your own needs */
  8. path = "Work:Texts/Diary/"
  9. name = "Fergus Duniho"
  10.  
  11. today = date(s)
  12. tagstr = "rt_reqpos=reqpos_centerscr rtfi_flags=freqf_patgad"
  13. fullname = rtfilerequest(path,today,"Select Diary Entry ...",,tagstr)
  14. if abbrev(fullname,path) = 0 then exit
  15. entry = delstr(fullname,1,length(path))
  16. password = rtgetstring(,,"Please Enter Password")
  17.  
  18. newwindow
  19. if exists(fullname) then do
  20.     xcom = 'execute (copy' fullname 't:temp)'
  21.     xcom
  22.     xcom = 'execute (xpack t:temp password "' || password || '")'
  23.     xcom
  24.     newfile "t:temp"
  25.     chfilename fullname
  26.     call delete("t:temp")
  27.     if entry < today then do
  28.         viewmode on
  29.     end
  30.     else do
  31.         (bottom downadd return)
  32.         C = "printf ((((((  %s  ))))))" time(c)
  33.         C
  34.         (justify center downadd downadd col 9)
  35.     end
  36. end
  37. else do
  38.     C1 = "insert (The Diary of" name "for" date(w) date(n) ")"
  39.     C2 = "printf ((((((  %s  ))))))" time(c)
  40.     C1
  41.     (justify center downadd downadd)
  42.     C2
  43.     (justify center downadd downadd col 9)
  44.     chfilename fullname
  45. end
  46. C = "menuadd Window (" || entry || ") (select (window=" || entry || "))"
  47. C
  48. C = "settvar method IDEA settvar password" password
  49. C
  50.